//
//  ContentView.swift
//  swift-ui
//
//  Created by zhaoguoteng on 2019/6/13.
//  Copyright © 2019 gaven. All rights reserved.
//

import SwiftUI

struct LandmarkDetail : View {
    var landmark: Landmark
    
    var body: some View {
        VStack {
            MapView(coordinate: landmarkData[0].locationCoordinate)
                .frame(height: 300)
            
            CircleImage(image: landmark.image(forSize: 250))
                .offset(y: -130)
                .padding(.bottom, -130)
            
            VStack(alignment: .leading) {
                Text(landmark.name)
                    .font(.title)
                    HStack {
                        Text(landmark.park)
                            .font(.subheadline)
                            Spacer()
                            Text(landmark.state)
                                .font(.subheadline)
                        }
                    }
                    .padding()
            
            Spacer()
            
            }
        .navigationBarTitle(Text(landmark.name), displayMode: .inline)
    }
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
    static var previews: some View {
        LandmarkDetail(landmark: landmarkData[0])
    }
}
#endif
